package com.wholesale.beans;

import org.json.JSONException;
import org.json.JSONObject;

public class WhoGoodsAttr {

	private int goodsAttrId ;
	private int goodsId ;
	private int attrId ;
	private String attrValue ;
	private String attrPrice ;
	private JSONObject jsonObject;
	public int getGoodsAttrId() {
		return goodsAttrId;
	}
	public void setGoodsAttrId(int goodsAttrId) {
		this.goodsAttrId = goodsAttrId;
	}
	public int getGoodsId() {
		return goodsId;
	}
	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}
	public int getAttrId() {
		return attrId;
	}
	public void setAttrId(int attrId) {
		this.attrId = attrId;
	}
	public String getAttrValue() {
		return attrValue;
	}
	public void setAttrValue(String attrValue) {
		this.attrValue = attrValue;
	}
	public String getAttrPrice() {
		return attrPrice;
	}
	public void setAttrPrice(String attrPrice) {
		this.attrPrice = attrPrice;
	}
	public void jsonAnalytic(String jsonString){
		
		try {
			jsonObject = new JSONObject(jsonString);
			jsonAnalytic(jsonObject);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void jsonAnalytic(JSONObject jsonObject){
		this.jsonObject = jsonObject;
		
			try {
				goodsAttrId = jsonObject.getInt("goodsAttrId");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				goodsId = jsonObject.getInt("goodsId");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				attrId = jsonObject.getInt("attrId");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				attrValue = jsonObject.getString("attrValue");
			} catch (JSONException e) {
				e.printStackTrace();
			}
			try {
				attrPrice = jsonObject.getString("attrPrice");
			} catch (JSONException e) {
				e.printStackTrace();
			}
		
	}
}
